local json = require('cjson.safe')

local str = [[{
  "name":"zhanghanyi",
  "age":27
}]]

local t = json.decode(str)

for k, v in pairs(t) do
  ngx.say(k,v)
end

if t then
  ngx.say('---> ',type(t))
end